﻿#ifndef FORMBASE64_H
#define FORMBASE64_H

#include <QLabel>
#include <QFrame>
#include <string>
#include <map>
#include "design/CustomTextEdit.h"
#include "design/CustomButton.h"

class FormBase64Proc : public QFrame
{
    Q_OBJECT
public:
    FormBase64Proc(QWidget* parent = nullptr);
    virtual ~FormBase64Proc() {}
private slots:
    void slt_decode();
    void slt_encode();
    void slt_md5();
    void slt_read();
    void slt_clear();
    void slt_saveAs();
    void slt_copy2Clipboard();
private:
    bool isFileAndRead(std::string &strSrc);
    bool hasData();
private:
    CustomTextEdit* m_pTextEdit;

    std::pair<QLabel*, QLabel*> m_pSrcFileType;
    std::pair<QLabel*, QLabel*> m_pSrcLenInfo;
    std::pair<QLabel*, QLabel*> m_pSrcMD5Info;
    std::pair<QLabel*, QLabel*> m_pDetLenInfo;
    std::pair<QLabel*, QLabel*> m_pDetMD5Info;
    std::pair<QLabel*, QLabel*> m_pSaveInfo;

    FluButton* m_pRead;
    FluButton* m_pMDValue;
    bool m_bMD5Value;
    std::string m_strLastData;
};

#endif
